package com.recSys.model;

import java.util.Date;

/**
 * @author dell
 *
 */
public class ServiceInfo implements Comparable<ServiceInfo>{
    private Integer id;
    
    private String servNum;

    private Integer orgID;

    private String servName;
    
    private String portrait;
    
    private String photos;

    private String servAbstract;

    private Integer servTypeID;

    private Double servPrice;

    private Integer servGroup;

    private Date startTime;

    private Date endTime;

    private Double avgRating;

    private Date addTime;
    
    private int state;
    
    private int isPublish;
    
    private String orgName;
    
    private String orgCode;
    
    private String orgTel;//机构电话
    
    private String regisAddr;//机构注册地
    
    private double longitude;//经度
    
    private double latitude;//纬度

    private int bookTimes;//预约次数
    

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getServNum() {
		return servNum;
	}

	public void setServNum(String servNum) {
		this.servNum = servNum;
	}

	public Integer getOrgID() {
        return orgID;
    }

    public void setOrgID(Integer orgID) {
        this.orgID = orgID;
    }
    
    public String getOrgTel() {
		return orgTel;
	}

	public void setOrgTel(String orgTel) {
		this.orgTel = orgTel;
	}

	public String getServName() {
        return servName;
    }

    public void setServName(String servName) {
        this.servName = servName == null ? null : servName.trim();
    }

    public String getServAbstract() {
        return servAbstract;
    }

    public void setServAbstract(String servAbstract) {
        this.servAbstract = servAbstract == null ? null : servAbstract.trim();
    }

    public Integer getServTypeID() {
        return servTypeID;
    }

    public void setServTypeID(Integer servTypeID) {
        this.servTypeID = servTypeID;
    }

    public Double getServPrice() {
        return servPrice;
    }

    public void setServPrice(Double servPrice) {
        this.servPrice = servPrice;
    }

    public Integer getServGroup() {
        return servGroup;
    }

    public void setServGroup(Integer servGroup) {
        this.servGroup = servGroup;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Double getAvgRating() {
        return avgRating;
    }

    public void setAvgRating(Double avgRating) {
        this.avgRating = avgRating;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getRegisAddr() {
		return regisAddr;
	}

	public void setRegisAddr(String regisAddr) {
		this.regisAddr = regisAddr;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public String getPortrait() {
		return portrait;
	}

	public void setPortrait(String portrait) {
		this.portrait = portrait;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public int getIsPublish() {
		return isPublish;
	}

	public void setIsPublish(int isPublish) {
		this.isPublish = isPublish;
	}

	public String getPhotos() {
		return photos;
	}

	public void setPhotos(String photos) {
		this.photos = photos;
	}

    public int getBookTimes() {
        return bookTimes;
    }

    public void setBookTimes(int bookTimes) {
        this.bookTimes = bookTimes;
    }

    public int compareTo(ServiceInfo s) {
        if(bookTimes != s.getBookTimes()){
            return bookTimes - s.getBookTimes();
        } else
            return id - s.getId();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ServiceInfo that = (ServiceInfo) o;

        return getId() != null ? getId().equals(that.getId()) : that.getId() == null;
    }

    @Override
    public int hashCode() {
        return getId() != null ? getId().hashCode() : 0;
    }
}